import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;

public class PrimeNumbers {
	public static void main(String[] args){
		Scanner reader = new Scanner(System.in);
		System.out.println("Enter the number");
		Integer input=reader.nextInt();
		List<Integer> myList = new ArrayList<Integer>();
		System.out.println("Prime numbers for "+input+":");
		for (Integer counter = 1; counter <= input; counter++) {
			for (Integer div = 1; div < counter; div++) {
				if (counter%div==0) {
					myList.add(counter);
				}
			}
			if (myList.size()==1) {
				System.out.println(myList.get(0));
			}
		myList.clear();
		}
	}
}